/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author NgocNTP60573
 */
public class connectData {
    public static Connection makeConnect(){
        Connection con = null;
        try {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
//            String url = "jdbc:sqlserver://localhost:1433; DatabaseName=LJO;";
//            con = DriverManager.getConnection(url, "dienvm", "vichiha");
            String url = "jdbc:sqlserver://localhost:1433; DatabaseName=LJO_new;";
            con = DriverManager.getConnection(url, "dienvm", "vichiha");
            return con;
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
